import img404 from '@$@/img/img404.gif';


//大类型分类
let bigEachCol={
  baseA(that,width) {
    let out = {
      title: "商品 / 类型",
      width: width || 350,
      resizable:true,
      className: `f_14 keepOneTxt ${!that.isHome && ` padding5-0`}`,
      render: (h, params) => {
        let {
          row: {
            order_type,
            goods_name
          }
        } = params;


        return h("div", [
          h("i", {
            class: `iconfont ${$app.orderTypeIcon(order_type)} cBlue f_35  pullLeft marginR20 `
          }),
          h("div", { class: "overflowH" }, [
            h(
              "div",
              { class: "lineH1d5  cBlue marginT5" },
              `${goods_name}`
            ),
            h(
              "div",
              { class: "lineH1d5 " },
              `${$app.orderTypeSwitch(order_type)}`
            )
          ])
        ]);
      }
    };
    return out;
  },
  baseB(that,width) {
    let out = {
      title: "金额（官费+服务费）",
      width: 200,
      resizable:true,
      className: `f_14 keepOneTxt ${!that.isHome && ` padding5-0`}`,
      render: (h, params) => {
        let {
          row: {
            order_money,
            official_fee,
            service_fee,
          }
        } = params;

        return h("div", [
          h(
            "div",
            { class: "lineH1d5  cRed" },
            `¥ ${parseFloat(order_money)} 元`
          ),
          h(
            "div",
            { class: "lineH1d5 " },
            `官：${parseFloat(official_fee)} ；  服：${parseFloat(service_fee)}`
          )
        ]);
      }
    };
    return out;
  },
  baseC(that,width) {
    let out = {
      title: "订单编号 / 下单时间",
      width: 200,
      resizable:true,
      className: `f_14 keepOneTxt ${!that.isHome && ` padding5-0`}`,
      render: (h, params) => {
        return h("div", [
          h("div", {
            class: "lineH1d5  f_12 c999",
            attrs: {
              title: params.row.order_no
            },
          }, `${params.row.order_no}`),
          h("div", { class: "lineH1d5  f_12 c999" }, `${params.row.created_at}`)
        ]);
      }
    };
    return out;
  },
  baseD(that,width) {
    let out = {
      title: "订单状态",
      width: width || 250 ,
      resizable:true,
      className: `f_14 keepOneTxt ${!that.isHome && ` padding5-0`}`,
      align: "center",
      render: (h, params) => {
        return h("div", [
          h("div", { class: "lineH1d5  cRed" }, `${params.row.state_name}`)
        ]);
      }
    };
    return out;
  },
  baseE(that,width) {
    let out = {
      title: "专利名称 / 专利号",
      resizable:true,
      className: `f_14 keepOneTxt ${!that.isHome && ` padding5-0`}`,
      width: $app.isMinScreen() ? '' : 200,
      render: (h, params) => {
        let {
          row: {
            patent_info: {
              name, patent_number
            }
          }
        } = params;

        let hasNum = $app.judgeData(patent_number);
        return h("div", [
          h("div", { class: `lineH1d5 ` }, `${name}`),
          h("div", { class: `lineH1d5  ${!hasNum && ` cCCC`}` }, `${hasNum ? patent_number : ' '}`)
        ]);
      }
    };
    return out;
  },
  baseF(that,width) {
    let out = {
      title: "申请人 / 发明人",
      width: $app.isMinScreen() ? 140 : '',
      resizable:true,
      className: `f_14 keepOneTxt ${!that.isHome && ` padding5-0`}`,
      render: (h, params) => {
        let {
          row: {
            patent_info: {
              applicant_name_list, inventor_name_list
            }
          }
        } = params;
        // console.log(params.row.patent_info)

        return h("div", [
          h("div", { class: "lineH1d5 " }, `${applicant_name_list}`),
          h("div", { class: "lineH1d5 " }, `${inventor_name_list}`)
        ]);
      }
    };
    return out;
  },
  baseG(that,width) {
    let out = {
      title: "专利订单状态",
      width: $app.isMinScreen() ? 130 : '',
      resizable:true,
      className: `f_14 keepOneTxt ${!that.isHome && ` padding5-0`}`,
      render: (h, params) => {
        let {
          row: {
            patent_info: {
              state_name
            }
          }
        } = params;
        return h("div", [
          h("div", { class: "lineH1d5  cRed" }, `${state_name}`)
        ]);
      }
    };
    return out;
  },
  baseH(that,width) {
    let out = {
      title: "商标名称 / 类型",
      resizable:true,
      className: `f_14 keepOneTxt ${!that.isHome && ` padding5-0`}`,
      width: $app.isMinScreen() ? '' : 200,
      render: (h, params) => {
        let {
          row: {
            goods_name,
            trademark_info: {
              name, apply_number
            }
          }
        } = params;

        return h("div", [
          h("div", { class: `lineH1d5  cBlue` }, `${name}`),
          h("div", { class: `lineH1d5 ` }, `${goods_name}`)
        ]);
      }
    };
    return out;
  },
  baseI(that,width) {
    let out = {
      title: "申请人 / 类型",
      width:250,
      resizable:true,
      className: `f_14 keepOneTxt ${!that.isHome && ` padding5-0`}`,
      render: (h, params) => {
        let {
          row: {
            trademark_info: {
              reg_people_name, reg_people_type,
            }
          }
        } = params;


        let lX = '';
        switch (parseInt(reg_people_type)) {
          case (1):
            lX = '企业';
            break;
          case (2):
            lX = '个体工商户';
            break;
        };


        return h("div", [
          h("div", { class: "lineH1d5 " }, `${reg_people_name}`),
          h("div", { class: "lineH1d5 " }, `${lX}`)
        ]);
      }
    };
    return out;
  },
  baseJ(that,width) {
    let out = {
      title: "商标订单状态",
      width: $app.isMinScreen() ? 150 : '',
      resizable:true,
      className: `f_14 keepOneTxt ${!that.isHome && ` padding5-0`}`,
      render: (h, params) => {
        let {
          row: {
            trademark_info: {
              state_name
            }
          }
        } = params;
        return h("div", [
          h("div", { class: "lineH1d5  cRed" }, `${state_name}`)
        ]);
      }
    };
    return out;
  },
  baseK(that,width) {
    let out = {
      title: "图样",
      align: "center",
      resizable:true,
      className: `f_14 keepOneTxt ${!that.isHome && ` padding5-0`}`,
      width: 120,
      render: (h, params) => {
        let {
          row: {
            trademark_info: {
              img_path
            }
          }
        } = params;


        return h("div", [
          h("img", {
            class: `f_12 cover inlineBlock padding5`,
            style: {
              width: `${that.isHome ? `50px` : `80px`}`,
              height: `${that.isHome ? `50px` : `80px`}`,
            },
            attrs: {
              src: img_path
            },
            on: {
              error: (event) => {
                event.target.src = img404;
              }
            }
          })
        ]);
      }
    };
    return out;
  },
  baseL(that,width) {
    let out = {
      title: "版权名称 / 申请人",
      resizable:true,
      width: 200,
      className: `f_14 keepOneTxt ${!that.isHome && ` padding5-0`}`,
      render: (h, params) => {

        //判断订单状态，显示不同按钮
        let {
          row: {
            order_type,
          }
        } = params, out = '';

        if (order_type != 10) {
          out = h("div", [
            h("div", { class: "lineH1d5 " }, `${$app.copyright_SW(params).bigName}`),
            h("div", { class: "lineH1d5 " }, `${$app.copyright_SW(params).people_name}`)
          ])
        }
        return out;
      }
    };
    return out;
  },
  baseM(that,width) {
    let out = {
      title: "版权订单状态",
      width: width||250,
      resizable:true,
      className: `f_14 keepOneTxt ${!that.isHome && ` padding5-0`}`,
      render: (h, params) => {
        //判断订单状态，显示不同按钮
        let {
          row: {
            order_type,
          }
        } = params, out = '';

        if (order_type != 10) {
          out = h("div", [
            h("div", { class: "lineH1d5  cRed" }, `${$app.copyright_SW(params).state_name}`)
          ])
        } else {
          out = h("div", [
            h("div", { class: "lineH1d5  cRed" }, `${params.row.state_name}`)
          ])
        }
        return out;
      }
    };
    return out;
  },
  baseO(that,width) {
    let out = {
      title: "商标名称 / 类别",
      resizable:true,
      className: `f_14 keepOneTxt ${!that.isHome && ` padding5-0`}`,
      width: width||300,
      render: (h, params) => {

        let {
          row: {
            tm_report: {
              tm_name, tm_type, id
            }
          }
        } = params;

        return h("div", [
          h("div", { class: "lineH1d5 " }, `${tm_name}`),
          h("div", { class: "lineH1d5 " }, `第${tm_type}类`)
        ]);
      }
    };
    return out;
  },
  baseBtn(that) {
    let out = {
      title: "操作 / 备注",
      className: `f_14 keepOneTxt ${!that.isHome && ` padding5-0`}`,
      align: "center",
      // fixed: 'right',
      render: (h, params) => {

        //判断订单状态，显示不同按钮
        let {
          row,
          row: {
            order_type,//1专利2商标3软著4美术 目前暂定只有这4个有详情
            state,//订单状态,0已取消,1已下单,2已支付
            //pay_type//0未支付,1余额,2猫币,3微信扫码支付,4微信公众号支付
          }
        } = params, btnList = [];




        if (state < 2) {
          btnList.push(
            h(
              $app.isMinScreen() ? "span" : "Button",
              {
                class: "marginR10 c999 pointer",
                props: {
                  icon: "ios-trash",
                  size: "small"
                },
                on: {
                  click: () => {
                    $app.delOrderSure(row.id, () => {
                      that.getList();//重新回来数据
                    });
                  }
                }
              },
              `删除`
            ),
            h(
              $app.isMinScreen() ? "span" : "Button",
              {
                class: "marginR10 " + ($app.isMinScreen() ? " cBlue textLink f_bold" : ""),
                props: {
                  type: "primary",
                  icon: "logo-yen",
                  size: "small",
                  ghost: true
                },
                on: {
                  click: () => {
                    that.btnPay(row);
                  }
                }
              },
              `支付`
            )
          );
        }

        if (order_type == 9) {
          if (!$app.judgeData(btnList)) {
            btnList.push(
              h(
                "span",
                {
                  class:"marginR10"
                },
                `数量：${row.num}`
              )
            );
          } else {
            //还没有付款
          }

          btnList.push(
            h(
              $app.isMinScreen() ? "span" : "Button",
              {
                class: ($app.isMinScreen() ? " cBlue textLink f_bold " : ""),
                props: {
                  icon: "ios-search",
                  size: "small",
                  type: "primary"
                },
                on: {
                  click: () => {
                    that.$Modal.success({
                      render: () => {
                        let out=[
                          h(
                            "div",
                            {
                              class:"marginB20 f_16"
                            },
                            `备注：${row.remark}`
                          ),
                          h(
                            "div",
                            {
                              class:"f_16"
                            },
                            `数量：${row.num}`
                          )
                        ];
                        return out;
                      }
                    });
                  }
                }
              },
              `详情`
            )
          );
        } else if (order_type == 10) {
          //毛都不做
        } else if ((order_type != 5 && order_type != 6) || ((order_type == 5 || order_type == 6) && state == 2)) {
          btnList.push(
            h(
              $app.isMinScreen() ? "span" : "Button",
              {
                class: ($app.isMinScreen() ? " cBlue textLink f_bold " : ""),
                props: {
                  icon: "ios-search",
                  size: "small",
                  type: "primary"
                },
                on: {
                  click: () => {
                    that.goInfo(params);
                  }
                }
              },
              `详情`
            )
          );
        }


        return h("div", $app.judgeData(btnList) ? btnList : '-');
      }
    };

    return out;
  }



};

// 表格 列 配置
export default bigEachCol;